﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;

namespace ebc.componentbinder.tests
{
    [TestFixture]
    public class test_OutputPin
    {
        [Test]
        public void Returns_parameter_type()
        {
            var ehd = new InputPin(new OnlyRelevantEventhandlers(), typeof(OnlyRelevantEventhandlers).GetMethod("ProcessString"));
            Assert.AreEqual(typeof (string), ehd.ParameterType);
        }

        [Test]
        public void Handles_naming_conventions()
        {
            var ehd = new InputPin(new OnlyRelevantEventhandlers(), typeof(OnlyRelevantEventhandlers).GetMethod("ProcessString"));
            Assert.AreEqual("String", ehd.PinName);
            ehd = new InputPin(new OnlyRelevantEventhandlers(), typeof(OnlyRelevantEventhandlers).GetMethod("HandleInt"));
            Assert.AreEqual("Int", ehd.PinName);
            ehd = new InputPin(new OnlyRelevantEventhandlers(), typeof(OnlyRelevantEventhandlers).GetMethod("XyzBool"));
            Assert.AreEqual("", ehd.PinName);
        }
    }
}
